using System;
using System.Collections.Generic;
using System.Reflection;
using System.Runtime.InteropServices;

using ILRuntime.CLR.TypeSystem;
using ILRuntime.CLR.Method;
using ILRuntime.Runtime.Enviorment;
using ILRuntime.Runtime.Intepreter;
using ILRuntime.Runtime.Stack;
using ILRuntime.Reflection;
using ILRuntime.CLR.Utils;
using System.Linq;

namespace ILRuntime.Runtime.Generated
{
    unsafe class huqiang_Communication_KcpFileInfo_Binding
    {
        public static void Register(ILRuntime.Runtime.Enviorment.AppDomain app)
        {
            BindingFlags flag = BindingFlags.Public | BindingFlags.Instance | BindingFlags.Static | BindingFlags.DeclaredOnly;
            MethodBase method;
            FieldInfo field;
            Type[] args;
            Type type = typeof(huqiang.Communication.KcpFileInfo);

            field = type.GetField("lastchangetime", flag);
            app.RegisterCLRFieldGetter(field, get_lastchangetime_0);
            app.RegisterCLRFieldSetter(field, set_lastchangetime_0);
            app.RegisterCLRFieldBinding(field, CopyToStack_lastchangetime_0, AssignFromStack_lastchangetime_0);
            field = type.GetField("url", flag);
            app.RegisterCLRFieldGetter(field, get_url_1);
            app.RegisterCLRFieldSetter(field, set_url_1);
            app.RegisterCLRFieldBinding(field, CopyToStack_url_1, AssignFromStack_url_1);
            field = type.GetField("length", flag);
            app.RegisterCLRFieldGetter(field, get_length_2);
            app.RegisterCLRFieldSetter(field, set_length_2);
            app.RegisterCLRFieldBinding(field, CopyToStack_length_2, AssignFromStack_length_2);
            field = type.GetField("msg", flag);
            app.RegisterCLRFieldGetter(field, get_msg_3);
            app.RegisterCLRFieldSetter(field, set_msg_3);
            app.RegisterCLRFieldBinding(field, CopyToStack_msg_3, AssignFromStack_msg_3);


            app.RegisterCLRCreateDefaultInstance(type, () => new huqiang.Communication.KcpFileInfo());
            app.RegisterCLRCreateArrayInstance(type, s => new huqiang.Communication.KcpFileInfo[s]);

            args = new Type[]{};
            method = type.GetConstructor(flag, null, args, null);
            app.RegisterCLRMethodRedirection(method, Ctor_0);

        }



        static object get_lastchangetime_0(ref object o)
        {
            return ((huqiang.Communication.KcpFileInfo)o).lastchangetime;
        }

        static StackObject* CopyToStack_lastchangetime_0(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((huqiang.Communication.KcpFileInfo)o).lastchangetime;
            __ret->ObjectType = ObjectTypes.Long;
            *(long*)&__ret->Value = result_of_this_method;
            return __ret + 1;
        }

        static void set_lastchangetime_0(ref object o, object v)
        {
            ((huqiang.Communication.KcpFileInfo)o).lastchangetime = (System.Int64)v;
        }

        static StackObject* AssignFromStack_lastchangetime_0(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            System.Int64 @lastchangetime = *(long*)&ptr_of_this_method->Value;
            ((huqiang.Communication.KcpFileInfo)o).lastchangetime = @lastchangetime;
            return ptr_of_this_method;
        }

        static object get_url_1(ref object o)
        {
            return ((huqiang.Communication.KcpFileInfo)o).url;
        }

        static StackObject* CopyToStack_url_1(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((huqiang.Communication.KcpFileInfo)o).url;
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static void set_url_1(ref object o, object v)
        {
            ((huqiang.Communication.KcpFileInfo)o).url = (System.String)v;
        }

        static StackObject* AssignFromStack_url_1(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            System.String @url = (System.String)typeof(System.String).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            ((huqiang.Communication.KcpFileInfo)o).url = @url;
            return ptr_of_this_method;
        }

        static object get_length_2(ref object o)
        {
            return ((huqiang.Communication.KcpFileInfo)o).length;
        }

        static StackObject* CopyToStack_length_2(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((huqiang.Communication.KcpFileInfo)o).length;
            __ret->ObjectType = ObjectTypes.Long;
            *(long*)&__ret->Value = result_of_this_method;
            return __ret + 1;
        }

        static void set_length_2(ref object o, object v)
        {
            ((huqiang.Communication.KcpFileInfo)o).length = (System.Int64)v;
        }

        static StackObject* AssignFromStack_length_2(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            System.Int64 @length = *(long*)&ptr_of_this_method->Value;
            ((huqiang.Communication.KcpFileInfo)o).length = @length;
            return ptr_of_this_method;
        }

        static object get_msg_3(ref object o)
        {
            return ((huqiang.Communication.KcpFileInfo)o).msg;
        }

        static StackObject* CopyToStack_msg_3(ref object o, ILIntepreter __intp, StackObject* __ret, IList<object> __mStack)
        {
            var result_of_this_method = ((huqiang.Communication.KcpFileInfo)o).msg;
            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }

        static void set_msg_3(ref object o, object v)
        {
            ((huqiang.Communication.KcpFileInfo)o).msg = (System.String)v;
        }

        static StackObject* AssignFromStack_msg_3(ref object o, ILIntepreter __intp, StackObject* ptr_of_this_method, IList<object> __mStack)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            System.String @msg = (System.String)typeof(System.String).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack), (CLR.Utils.Extensions.TypeFlags)0);
            ((huqiang.Communication.KcpFileInfo)o).msg = @msg;
            return ptr_of_this_method;
        }



        static StackObject* Ctor_0(ILIntepreter __intp, StackObject* __esp, IList<object> __mStack, CLRMethod __method, bool isNewObj)
        {
            ILRuntime.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject* __ret = ILIntepreter.Minus(__esp, 0);

            var result_of_this_method = new huqiang.Communication.KcpFileInfo();

            return ILIntepreter.PushObject(__ret, __mStack, result_of_this_method);
        }


    }
}
